{extend name="admin@index_layout"/}
{block name="main"}
<div class="layui-card">
    <div class="layui-card-header">搜索管理</div>
    <div class="layui-card-body">
        <table class="layui-hide" id="currentTable" lay-filter="currentTable"></table>
    </div>
</div>
<script type="text/html" id="barTool">
    <a href='{:url("del")}?ids={{ d.id }}' class="layui-btn layui-btn-danger layui-btn-xs layui-tr-del">删除</a>
</script>
{/block}
{block name="script"}
<script>
layui.use(['yznTable', 'upload'], function() {
    var table = layui.yznTable,
        $ = layui.$,
        upload = layui.upload;

    var init = {
        table_elem: '#currentTable',
    };

    table.render({
        init: init,
        id: 'currentTable',
        elem: '#currentTable',
        toolbar: ['refresh','delete',
        ],
        url: '{:url("index")}',
        search:false,
        cols: [
            [
                { type: 'checkbox', fixed: 'left' },
                { field: 'id', width: 70, title: 'ID' },
                { field: 'keywords', width: 150, title: '关键字' },
                { field: 'site_id', width: 150, title: '站点ID', align:'center'},
                { field: 'nums',width: 150, title: '搜索次数', align:'center', sort:'true'},
                { field: 'ip', title: 'ip' },
                { field: 'create_time', width: 160, align:'center', title: '创建时间', search: 'range' },
                { fixed: 'right', align:'center', width: 130, title: '操作', toolbar: '#barTool' }
            ]
        ]
    });
});
</script>
{/block}